export function downloadpdf(data) {
  // var blob = data;
  // if(blob.type == "text/html"){
  //   tip("出错");
  //   return false
  // }
  // var fileName = "walmart.pdf";
  // if(window.navigator.msSaveOrOpenBlob){			// IE浏览器下
  //   navigator.msSaveBlob(blob, fileName);
  // } else {
  //
  //   var binaryData = [];
  //   binaryData.push(data);
  //   var  link = window.URL.createObjectURL(new Blob(binaryData, {type: "application/zip"}))
  //
  //   // var  link = document.createElement("a");
  //   link.href = window.URL.createObjectURL(blob);
  //   link.download = fileName;
  //   link.click();
  //   window.URL.revokeObjectURL(link.href);
  // }

  const url = window.URL.createObjectURL(new Blob([data]))
  const link = document.createElement('a')
  link.style.display = 'none'
  link.href = url
  link.setAttribute('download', filename)
  document.body.appendChild(link)
  link.click()
  URL.revokeObjectURL(link.href)
  document.body.removeChild(link)
}
function download(blobUrl) {
  const a = document.createElement('a')
  a.style.display = 'none'
  a.download = 'pdf.pdf'
  a.href = blobUrl
  a.click()
  document.body.removeChild(a)
}

